package com.game.server.message.proto.execute;

import com.comm.ISession;
import com.game.majiang.config.LogManager;
import com.game.majiang.logic.LogicClient;
import com.game.majiang.logic.LogicPlayer;
import com.game.majiang.logic.LogicServer;
import com.game.majiang.logic.LogicTable;
import com.game.server.message.proto.in.AbstractReadyReq;
import com.game.server.message.proto.out.ReadyRsp;

public class ReadyReq extends AbstractReadyReq {

	@Override
	public void Execute(ISession session) {
		LogManager.getInstance().Log("准备");
		LogicClient client = (LogicClient) LogicServer.getInstance().getClient(session.getId());
		if (client != null&&client.checkClick(msgcode)) {
			LogicPlayer player = (LogicPlayer)client.getPlayer();
			if(player != null)
			{
				LogicTable table = (LogicTable)client.getTable();
				if(table != null)
				{        	
					
				}
				else
				{
					ReadyRsp rsp = new ReadyRsp();
					rsp.setIsOK((byte) 5);
					client.Send(rsp);
					return;

				}
			}
			else
			{
				ReadyRsp rsp = new ReadyRsp();
				rsp.setIsOK((byte) 5);
				client.Send(rsp);
				return;

			}
		}
	}

}
